import Mock from 'mockjs'
import { doCustomTimes } from '@/libs/util'
const Random = Mock.Random

export const getTableData = req => {
  let tableData = []
  doCustomTimes(21, () => {
    tableData.push(Mock.mock({
      uid: '17',
      code: '5',
      name: '@name',
      friend: '@name',
      friendcircle: '11',
      idnumber: '44522219952015556',
      bank: 'huaxi',
      SavingsDepositCard: '622210020010102',
      phonenumber: '15815522512',
      Totalbalance: 155,
      usebalance: 100,
      realname: '是',
      Substitute: '否',
      status: '正常',
      version: 2,
      time: '@date'
    }))
  })
  console.log(req)
  return { tableData, total: 66 }
}

export const getDragList = req => {
  let dragList = []
  doCustomTimes(5, () => {
    dragList.push(Mock.mock({
      name: Random.csentence(10, 13),
      id: Random.increment(10)
    }))
  })
  return dragList
}

export const getuserinfo = req => {
  let data = [{title: '用户ID', value: '133'},
    {title: '登录名', value: '133'},
    {title: '用户名', value: '133'},
    {title: '微信id', value: '133'},
    {title: '创建时间', value: '133'}
  ]
  return data
}

export const getConsumptionFlow = req => {
  let tableData = []
  doCustomTimes(21, () => {
    tableData.push(Mock.mock({
      id: '55',
      code: '5',
      realname: '@name',
      payid: '11564',
      paymoney: '11565',
      phonenumber: '15815522512',
      paycardid: '6222151545454545',
      paybank: '中国银行',
      style: '消费',
      procedures: 49,
      rate: 1,
      passageway: 'yinsheng',
      remark: '-',
      time: '@date',
      comsumption: 'success',
      status: '正常'
    }))
  })
  return { tableData, total: 66 }
}

export const getRepayFlow = req => {
  let tableData = []
  doCustomTimes(21, () => {
    tableData.push(Mock.mock({
      code: '5',
      realname: '@name',
      planid: 'plan-B',
      repayid: '11564',
      paymoney: '11565',
      phone: '15815522512',
      paycardid: '6222151545454545',
      paybank: '中国银行',
      style: '还款',
      repay: '',
      locking: '未锁',
      isclose: '已结束',
      procedures: 49,
      rate: 1,
      passageway: 'yinsheng',
      remark: '-',
      time: '@date',
      comsumption: 'success',
      status: '完成'
    }))
  })
  return { tableData, total: 66 }
}
